package com.example.templateapp

import net.sourceforge.pinyin4j.PinyinHelper
import org.junit.Assert.assertEquals
import org.junit.Test

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * See [testing documentation](http://d.android.com/tools/testing).
 */
class ExampleUnitTest {
    @Test
    fun addition_isCorrect() {
        assertEquals(4, 2 + 2)
    }

    @Test
    fun map_test() {
        val l = arrayListOf<String>("1", "2", "2", "2", "2")
        l.filter { it.equals("1") }.map { println(it.plus(",")) }
    }

    /**
     * toGwoyeuRomatzyhStringArray=[yang]
     * toHanyuPinyinStringArray=[yang2]
     * toHanyuPinyinStringArray=[yang2]
     * toMPS2PinyinStringArray=[yang2]
     * toTongyongPinyinStringArray=[yang2]
     * toWadeGilesPinyinStringArray=[yang2]
     * toYalePinyinStringArray=[yang2]
     */
    @Test
    fun pinYinTest() {
        val key: Char = "杨洋"[0]
        println(
            "toGwoyeuRomatzyhStringArray=${PinyinHelper.toGwoyeuRomatzyhStringArray(key).toList()}"
        )
        println("toHanyuPinyinStringArray=${PinyinHelper.toHanyuPinyinStringArray(key).toList()}")
        println("toHanyuPinyinStringArray=${PinyinHelper.toHanyuPinyinStringArray(key).toList()}")
        println("toMPS2PinyinStringArray=${PinyinHelper.toMPS2PinyinStringArray(key).toList()}")
        println(
            "toTongyongPinyinStringArray=${PinyinHelper.toTongyongPinyinStringArray(key).toList()}"
        )
        println(
            "toWadeGilesPinyinStringArray=${PinyinHelper.toWadeGilesPinyinStringArray(key)
                .toList()}"
        )
        println("toYalePinyinStringArray=${PinyinHelper.toYalePinyinStringArray(key).toList()}")
    }
}